package org.gavin.core.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class BaseException extends RuntimeException{
    /**
     * 所属模块
     */
    private String module;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误码对应的参数
     */
    private Object args;

    /**
     * 错误消息
     */
    private String msg;

    public BaseException(String module, Integer code, Object args, String msg) {
        super(msg);
        this.module = module;
        this.code = code;
        this.args = args;
        this.msg = msg;
    }
}
